home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / huge / huge.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  2.1 KB  |  67 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   2235
  5.    ClientLeft      =   3165
  6.    ClientTop       =   2190
  7.    ClientWidth     =   6240
  8.    Height          =   2640
  9.    Left            =   3105
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2235
  13.    ScaleWidth      =   6240
  14.    Top             =   1845
  15.    Width           =   6360
  16.    Begin ListBox List1 
  17.       Height          =   1980
  18.       Left            =   120
  19.       TabIndex        =   0
  20.       Top             =   120
  21.       Width           =   6015
  22.    End
  23. DefInt A-Z
  24. Sub Form_Load ()
  25.     Show
  26.     'make huge array
  27.     recsize = 128                               'array element size
  28.     numrecs = 100                               'number of elements
  29.     HugeDIM handle, status, recsize, numrecs    'make array
  30.     If status > 0 Then MsgBox HugeERR(status), 48
  31.     'save a string into huge array
  32.     recdata$ = "Some nifty data for record 1"
  33.     HugePUT handle, status, 1, recdata$
  34.     'save a string into huge array
  35.     recdata$ = "Some nifty data for record 2"
  36.     HugePUT handle, status, 2, recdata$
  37.     If status > 0 Then MsgBox HugeERR(status), 48
  38.     'save a string into huge array
  39.     recdata$ = "Some nifty data for record 3"
  40.     HugePUT handle, status, 3, recdata$
  41.     If status > 0 Then MsgBox HugeERR(status), 48
  42.     'zap string
  43.     recdata$ = ""
  44.     'read strings back and prove it works
  45.     HugeGET handle, status, 1, recdata$
  46.     If status > 0 Then
  47.         MsgBox HugeERR(status), 48
  48.     Else
  49.         list1.AddItem recdata$
  50.     End If
  51.     HugeGET handle, status, 2, recdata$
  52.     If status > 0 Then
  53.         MsgBox HugeERR(status), 48
  54.     Else
  55.         list1.AddItem recdata$
  56.     End If
  57.     HugeGET handle, status, 3, recdata$
  58.     If status > 0 Then
  59.         MsgBox HugeERR(status), 48
  60.     Else
  61.         list1.AddItem recdata$
  62.     End If
  63.     'free up memory & close array *very important!*
  64.     HugeZAP handle, status
  65.     If status > 0 Then MsgBox HugeERR(status), 48
  66. End Sub
  67.